<template>
  <div class="containner">
    <el-dialog
      :visible.sync="visible"
      :title="title"
      :width="width"
      :center="center"
      :fullscreen="fullscreen"
      :show-close="showClose"
      :before-close="handleClose"
      :top="top"
      :close-on-click-modal="clickModal"
    >
      <div class="scrollbar">
        <el-scrollbar style="height: 100%">
          <div class="content">
            <slot name="content"></slot>
          </div>
          <div class="footer">
            <slot name="footer"></slot>
          </div>
        </el-scrollbar>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: "提示",
    },
    width: {
      type: String,
      default: "30%",
    },
    center: {
      type: Boolean,
      default: false,
    },
    fullscreen: {
      type: Boolean,
      default: false,
    },
    showClose: {
      type: Boolean,
      default: true,
    },
    top: {
      type: String,
      default: "15vh",
    },
    // 是否点击body隐藏
    clickModal: {
      type: Boolean,
      default: false,
    },
  },
  components: {},

  data() {
    return {};
  },

  created() {},

  mounted() {},

  methods: {
    handleClose() {
      this.$emit("update:visible");
    },
  },
};
</script>
<style lang="scss" scoped>
.footer {
  margin-top: 40px;
  text-align: center;
}
/* 弹出框滚动条 */
/* 设置滚动条的样式 */
/**解决了滚动条之间发生错位的现象 */
:deep(.scrollbar) {
  max-height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 30px;
}
</style>
